3.16 \(\int \frac{\sec ^2(x)}{a+b \cot (x)} \, dx\)

Optimal. Leaf size=29 \[ -\frac{b \log (\tan (x))}{a^2}-\frac{b \log (a+b \cot (x))}{a^2}+\frac{\tan (x)}{a} \]

[Out]

-((b*Log[a + b*Cot[x]])/a^2) - (b*Log[Tan[x]])/a^2 + Tan[x]/a

________________________________________________________________________________________

Rubi [A]  time = 0.055597, antiderivative size = 29, normalized size of antiderivative = 1., number of steps used = 3, number of rules used = 2, integrand size = 13, \(\frac{\text{number of rules}}{\text{integrand size}}\) = 0.154, Rules used = {3516, 44} \[ -\frac{b \log (\tan (x))}{a^2}-\frac{b \log (a+b \cot (x))}{a^2}+\frac{\tan (x)}{a} \]

Antiderivative was successfully verified.

[In]

Int[Sec[x]^2/(a + b*Cot[x]),x]

[Out]

-((b*Log[a + b*Cot[x]])/a^2) - (b*Log[Tan[x]])/a^2 + Tan[x]/a

Rule 3516

Int[sin[(e_.) + (f_.)*(x_)]^(m_)*((a_) + (b_.)*tan[(e_.) + (f_.)*(x_)])^(n_), x_Symbol] :> Dist[b/f, Subst[Int
[(x^m*(a + x)^n)/(b^2 + x^2)^(m/2 + 1), x], x, b*Tan[e + f*x]], x] /; FreeQ[{a, b, e, f, n}, x] && IntegerQ[m/
2]

Rule 44

Int[((a_) + (b_.)*(x_))^(m_.)*((c_.) + (d_.)*(x_))^(n_.), x_Symbol] :> Int[ExpandIntegrand[(a + b*x)^m*(c + d*
x)^n, x], x] /; FreeQ[{a, b, c, d}, x] && NeQ[b*c - a*d, 0] && ILtQ[m, 0] && IntegerQ[n] &&  !(IGtQ[n, 0] && L
tQ[m + n + 2, 0])

Rubi steps

\begin{align*} \int \frac{\sec ^2(x)}{a+b \cot (x)} \, dx &=-\left (b \operatorname{Subst}\left (\int \frac{1}{x^2 (a+x)} \, dx,x,b \cot (x)\right )\right )\\ &=-\left (b \operatorname{Subst}\left (\int \left (\frac{1}{a x^2}-\frac{1}{a^2 x}+\frac{1}{a^2 (a+x)}\right ) \, dx,x,b \cot (x)\right )\right )\\ &=-\frac{b \log (a+b \cot (x))}{a^2}-\frac{b \log (\tan (x))}{a^2}+\frac{\tan (x)}{a}\\ \end{align*}

Mathematica [A]  time = 0.082131, size = 27, normalized size = 0.93 \[ \frac{-b \log (a \sin (x)+b \cos (x))+a \tan (x)+b \log (\cos (x))}{a^2} \]

Antiderivative was successfully verified.

[In]

Integrate[Sec[x]^2/(a + b*Cot[x]),x]

[Out]

(b*Log[Cos[x]] - b*Log[b*Cos[x] + a*Sin[x]] + a*Tan[x])/a^2

________________________________________________________________________________________

Maple [A]  time = 0.038, size = 21, normalized size = 0.7 \begin{align*}{\frac{\tan \left ( x \right ) }{a}}-{\frac{b\ln \left ( a\tan \left ( x \right ) +b \right ) }{{a}^{2}}} \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

int(sec(x)^2/(a+b*cot(x)),x)

[Out]

tan(x)/a-b/a^2*ln(a*tan(x)+b)

________________________________________________________________________________________

Maxima [A]  time = 1.18012, size = 27, normalized size = 0.93 \begin{align*} -\frac{b \log \left (a \tan \left (x\right ) + b\right )}{a^{2}} + \frac{\tan \left (x\right )}{a} \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(sec(x)^2/(a+b*cot(x)),x, algorithm="maxima")

[Out]

-b*log(a*tan(x) + b)/a^2 + tan(x)/a

________________________________________________________________________________________

Fricas [A]  time = 2.20457, size = 165, normalized size = 5.69 \begin{align*} -\frac{b \cos \left (x\right ) \log \left (2 \, a b \cos \left (x\right ) \sin \left (x\right ) -{\left (a^{2} - b^{2}\right )} \cos \left (x\right )^{2} + a^{2}\right ) - b \cos \left (x\right ) \log \left (\cos \left (x\right )^{2}\right ) - 2 \, a \sin \left (x\right )}{2 \, a^{2} \cos \left (x\right )} \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(sec(x)^2/(a+b*cot(x)),x, algorithm="fricas")

[Out]

-1/2*(b*cos(x)*log(2*a*b*cos(x)*sin(x) - (a^2 - b^2)*cos(x)^2 + a^2) - b*cos(x)*log(cos(x)^2) - 2*a*sin(x))/(a
^2*cos(x))

________________________________________________________________________________________

Sympy [F]  time = 0., size = 0, normalized size = 0. \begin{align*} \int \frac{\sec ^{2}{\left (x \right )}}{a + b \cot{\left (x \right )}}\, dx \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(sec(x)**2/(a+b*cot(x)),x)

[Out]

Integral(sec(x)**2/(a + b*cot(x)), x)

________________________________________________________________________________________

Giac [A]  time = 1.31513, size = 28, normalized size = 0.97 \begin{align*} -\frac{b \log \left ({\left | a \tan \left (x\right ) + b \right |}\right )}{a^{2}} + \frac{\tan \left (x\right )}{a} \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(sec(x)^2/(a+b*cot(x)),x, algorithm="giac")

[Out]

-b*log(abs(a*tan(x) + b))/a^2 + tan(x)/a